/*
 * HttpPost.h
 *
 *  Created on: 2010-7-15
 *      Author: zhzuo
 */

#ifndef HTTPPOST_H_
#define HTTPPOST_H_

#include <QtNetwork>
#include <QFile>
#include <iostream>
#include <QObject>

class QUrl;
class QHttp;
class QFile;

class HttpPost : public QObject {
    Q_OBJECT

public:
    HttpPost(QObject *parent = 0);
    void downloadFile(const QUrl &url,QString data);
    void downloadFile(const QUrl &url,QByteArray* data);
    QString getString();
    //QFile getFile();
    
signals:
    void finished();
    
private slots:
    void done(bool error);
    
private:
    QHttp *http;
    QBuffer *buffer;
};

#endif /* HTTPPOST_H_ */
